import com.sun.org.apache.bcel.internal.generic.NEW;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;


public class IoTest {
    public static void main(String[] args) throws Exception {
        String path = "D:\\zuoye\\ceshi\\ceshi.txt";
        inputStreamFile(path);
    }

    public static void inputStreamFile(String path) throws Exception {
        File file = new File(path);
        FileInputStream ins = new FileInputStream(file);
        BufferedInputStream bi = new BufferedInputStream(ins);
        byte[]  buffer= new byte[1024];
        int len;
        while ((len=bi.read(buffer))!=-1){
        String str=new String(buffer);
            System.out.println(str);

        }
        bi.close();
    }
}
